<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Promise.reject</title>
  </head>
  <body>
    <script>
      // reject
      // 也是 Promise 函数对象身上的一个方法
      // 作用: 快速创建失败的 promise 实例对象
      var p = Promise.reject('123');
      var p = Promise.reject(true);
      var p = Promise.reject({value: true});
      var p = Promise.reject(new Promise((resolve, reject) => {
        resolve('OKOK');
      }));


      var p = Promise.resolve(Promise.resolve(Promise.resolve("OK")));
      // var p = Promise.resolve(Promise.resolve(Promise.reject("OK")));
      // var p = Promise.resolve(Promise.reject(Promise.resolve("OK")));

      console.log(p);


    </script>
  </body>
</html>
